<html>
    <script>

    // 调用相机
    function requestPhoto() {
        var  p1 = document.getElementById("p1");
        p1.innerHTML = "requestPhone";
        window.location.href = "app:requestPhoto?callBack=success&type=01";
    }
    // 调用通讯录
    function requestContactList() {
        var  p1 = document.getElementById("p1");
        p1.innerHTML = "requestPhone";
        window.location.href = "app:requestContactList?callBack=success&type=1";
    }
    
    function success(result) {
        var  p1 = document.getElementById("p1");
        p1.innerHTML = result.toString();
    }
    
    function showPersonTel(name,tel) {
        var p1 = document.getElementById("p1");
        p1.innerHTML = name + "'s Tel is " + tel;
    }

    function wkwebJsCallOc() {
        var list = [1,2,3];
        var dict = {"name":"lizq","qq":"597759199","list":list};
        // JS 通知 WKWebView
        window.webkit.messageHandlers.JsCallOc.postMessage(dict);
    }
    
    function nomethodCall() {
        var string = "hello objective-c";
        // JS 通知 WKWebView
        window.webkit.messageHandlers.nomethodCall.postMessage(string);
    }
    </script>
    
    <body>
        <br>
        <img id="image" width = 320  height = 480>
        <br>
        <button type="button" onclick="requestPhoto()">Camera</button>
        <br>
        <button type="button" onclick="requestContactList()">Address Book</button>
        <br>
        <button type="button" onclick="action('gotoWKWebView')">WKWebView</button>
        <br>
        <p id = "p1"></p>
    </body>
</html>